From c22612f44148ee789e6746a5f2afb8bf7506064b Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Fri, 17 Sep 2004 20:33:02 +0000 Subject: [PATCH] segfault when waypoints didn't have descriptions e.g. '-i arc' --- waypt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/waypt.c b/waypt.c index 04acd2ec1..f91b503f2 100644 --- a/waypt.c +++ b/waypt.c @@ -131,15 +131,17 @@ waypt_disp(const waypoint *wpt) } printposn(wpt->latitude,1); printposn(wpt->longitude,0); - - tmpdesc = str_utf8_to_ascii( wpt->description); - printf("%s/%s", - global_opts.synthesize_shortnames ? + + if ( wpt->description ) { + tmpdesc = str_utf8_to_ascii( wpt->description); + printf("%s/%s", + global_opts.synthesize_shortnames ? mkshort(mkshort_handle, tmpdesc) : wpt->shortname, tmpdesc); - if ( tmpdesc ) - xfree(tmpdesc); + if ( tmpdesc ) + xfree(tmpdesc); + } if (wpt->altitude != unknown_alt) printf(" %f", wpt->altitude); -- 2.30.2